<!-- 登录组件, 普通登录 -->
<template>
<body id="poster">
  <div class="logintitle">
    <img class="sidebar-logo" src="../assets/img/logo.png" />
    <h1>系统登录界面</h1>
  </div>
  <div class="logoform animated fadeIn">
    <div class="formtitle">用户登录</div>
    <div class="forminput user">
      <input placeholder="用户名" v-model="form.username" />
      <div class="horn j1"></div>
      <div class="horn j2"></div>
      <div class="horn j3"></div>
      <div class="horn j4"></div>
    </div>
    <div class="forminput password">
      <input type="password" placeholder="密码" v-model="form.password" />
      <div class="horn j1"></div>
      <div class="horn j2"></div>
      <div class="horn j3"></div>
      <div class="horn j4"></div>
    </div>
    <p></p>
    <div class="formbtn">
      <a href="#" class="dlbtn" style="color:#fff !important" @click="login">登录</a>
    </div>
  </div>
</body>
</template>
 
 
<script>
export default {
  name: "Login",
  data() {
    return {
      form: {
        username: "admin",
        password: "hnkc2017"
      }
    };
  },
  created: function() {
    // this.$axios.post('currentUser/logout').then(resp => {
    // });
  },
  methods: {
    login: function() {
      var that = this;
      if (that.form.username == "") {
        this.$message({
          message: "用户名不能为空",
          type: "warning"
        });
        return fasle;
      }
      if (that.form.password == "") {
        this.$message({
          message: "密码不能为空",
          type: "warning"
        });
        return fasle;
      }

      // that.$axios.post("currentUser/login", that.form).then(resp => {
        // let lastRoutre = that.$router.currentRoute.query.redirect;
        // if (lastRoutre) {
        //   that.$router.push({
        //     path: decodeURIComponent(that.$router.currentRoute.query.redirect)
        //   });
        //   return;
        // }
        // that.$router.push("/main");
      // });
      let lastRoutre = that.$router.currentRoute.query.redirect;
      if (lastRoutre) {
        that.$router.push({
          path: decodeURIComponent(that.$router.currentRoute.query.redirect)
        });
        return;
      }
      that.$router.push("/main");
    }
  }
};
</script>
 
<style>
#poster {
  background: url("../assets/img/06097fbdf70d4a18c1de3a1a30475ac9.jpg")
    no-repeat;
  background-position: center;
  height: 100%;
  width: 100%;
  background-size: cover;
  position: fixed;
}
body {
  margin: 0px;
  padding: 0;
}

.logintitle {
  width: 90%;
  height: 75px;
  margin: 7% auto 0;
  line-height: 75px;
  font-family: "华文中宋";
  color: #1d81fd;
  text-align: center;
}
.logintitle h1 {
  display: inline-block;
  font-size: 44px;
  background-image: linear-gradient(#8fefff, #1765ff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  padding: 0;
}
.logoform {
  width: 420px;
  height: 680px;
  margin-left: 55%;
  margin-top: 6.5%;
  position: relative;
  background: url("../assets/img/bc55530853727e38780b18a224459793.png")
    no-repeat;
}
.formtitle {
  width: 100%;
  height: 120px;
  line-height: 120px;
  color: #0bb2ff;
  font-size: 24px;
  text-align: center;
  padding-top: 20px;
}
.logoform p {
  display: block;
  width: 300px;
  text-align: right;
  color: #06bcff;
  margin: 20px auto;
}

.user {
  background-image: url("../assets/img/ebc8ccba50ffeefc4a1d98a70cea2656.png");
}
.password {
  background-image: url("../assets/img/62f358e07ca5ca3f7eddeaf33d9b5fbb.png");
}
.forminput {
  width: 300px;
  margin: 0 auto 40px auto;
  background-color: rgba(14, 177, 255, 0.2);
  background-repeat: no-repeat;
  background-position: 260px center;
  height: 45px;
  line-height: 45px;
  position: relative;
}
.forminput input {
  display: block;
  width: 250px;
  height: 43px;
  line-height: 45px;
  outline: none;
  background: none;
  border: none;
  color: #1db2ff;
  padding: 0 40px 0 10px;
}
.j1 {
  left: 0;
  bottom: 0;
  background: url("../assets/img/c8d2d0296c9a2ea488463f594242d50c.png")
    no-repeat;
}
.j2 {
  right: 0;
  bottom: 0;
  background: url("../assets/img/be0ff7f3408e2324fc384fd9173583a6.png")
    no-repeat;
}
.j3 {
  right: 0;
  top: 0;
  background: url("../assets/img/869737897c30cbeab67d502c32d8cef6.png")
    no-repeat;
}
.j4 {
  left: 0;
  top: 0;
  background: url("../assets/img/4203a2109125ed63e654855cc9fa71e3.png")
    no-repeat;
}
.horn {
  width: 10px;
  height: 10px;
  position: absolute;
}
.formbtn {
  width: 295px;
  margin: 0 auto;
}
.dlbtn {
  display: inline-block;
  height: 50px;
  line-height: 50px;
  width: 100%;
  background: #2385fd;
  border-radius: 5px;
  font-size: 18px;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
}
.dlbtn:hover {
  background: #0f93ef;
}
.sidebar-logo {
  width: 75px;
  height: 75px;
  vertical-align: middle;
  margin: 0px 5px 20px 15px;
}
</style>